package SpringBoot.__template.web集成FreeMarker.controller;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.titan.core.utils.data.FormatUtils;
import com.titan.core.web.utils.ControllerUtils;

/**
 *
 *
 * @author 周成功
 *
 */
@RestController
@RequestMapping(value = "/D01")
public class D01Controller {
    @RequestMapping(value = "/hello")
    public ModelAndView hello(HttpServletRequest request, HttpServletResponse response) throws Exception {
        List<String> userList=new ArrayList<String>();
        userList.add("admin");
        userList.add("user1");
        userList.add("user2");
        request.setAttribute("userList", userList);
        request.setAttribute("strVar", "zzz, " + FormatUtils.getSysdate("yyyy-MM-dd HH:mm:ss"));
        return ControllerUtils.toView("/index.ftl");
    }    

}
